<?php if(!defined('BASEPATH')) exit('No direct script access allowed!');
class Status_Model extends MY_Model{
	function __construct(){
		parent::__construct();
	}
	
	protected $_table_name = 'status';
	
	public function lists_array(){
		$rs = $this->db->get($this->_table_name)->result_array();
		$data = array();
		$data[0] = '';
		foreach($rs as $row){
			$data[ $row['id'] ] = $row['nama'];
		}
		return $data;
	}
	
	public function get_name($id){
		$this->db->where('id',$id);
		$rs = $this->db->get($this->_table_name)->row_array();
		return isset($rs['nama'])?$rs['nama']:'';
	}

	public function get_by_name($nama) {
		$this->db->where('nama', $nama);
		$rs = $this->db->get($this->_table_name);
		return $rs->row_array();
	}
}
?>
